package com.wsd.smartcarwasher.service;

import com.wsd.smartcarwasher.dao.ProblemMapper;
import com.wsd.smartcarwasher.domain.Problem;
import com.wsd.smartcarwasher.domain.ProblemExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.security.PrivateKey;
import java.util.List;

@Service
public class ProblemService {

    @Resource
    private ProblemMapper ProblemMapper;
    public List<Problem> getProblem() {
        return ProblemMapper.getProblem();
    }

    public List<Problem> getAll() {
        return ProblemMapper.selectByExample(new ProblemExample());
    }

    public int insert(Problem problem) {

        return ProblemMapper.insert(problem);
    }

    public int update(Problem problem) {

        return ProblemMapper.updateByPrimaryKeySelective(problem);
    }

    public int delete(Integer id) {

        return ProblemMapper.deleteByPrimaryKey(id);
    }
}
